#pragma once
#include "Vector3.h"
#define PI 3.1415926535897932384626433832795028841971693993751058209749445923078164062f
#include "Matrix.h"
#include "NBE.h"
#include "Listener.h"
namespace NBE
{
	class NBE_API Camera: public Listener
	{
	public:
		Camera();
		virtual void handleEvent(Event* e);
		void handleKeyDown(int key);
		void setPosition(const vec3f& position){m_pos = position;}
		//void setDirection(const vec3f& direction){m_direction = direction;}
		void applyImpulse(const vec3f& impulse);
		//void applyWorldBasisImpulse(const vec3f& worldImpulse);
		const vec3f& getRotation();//degree
		const vec3f& setRotation(const vec3f& rotation);
		void rotate(const vec3f& change);
		const vec3f& getDirection();
		
		void updateViewMatrix();
		Matrix4f setProjection(float fov, float aspect,float znear, float zfar);

		inline vec3f& getUp(){return m_up;}
		//camera up
		inline vec3f& getPosition(){return m_pos;}
		inline Matrix4f getProjection(){return m_projection;}
		inline Matrix4f getViewMatrix(){return m_view;}
	private:
		vec3f m_pos;
		vec3f m_rotation;
		
		vec3f m_direction;
		vec3f m_up;


		Matrix4f m_view;
		Matrix4f m_projection;
	};
}